package com.shop.cloud.model;

import java.time.OffsetDateTime;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.shop.cloud.common.mapper.OffsetDateTimeToIso8601Serializer;

import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 标识Domain并且限定CrudService边界
 *
 * @author Alex
 */
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" }, ignoreUnknown = true)
public class BasicDomain extends IdentityDomain {

	private static final long serialVersionUID = 6404939125344686735L;

	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
	@Override
	public OffsetDateTime getCreateTime() {
		return super.getCreateTime();
	}

	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
	@Override
	public OffsetDateTime getUpdateTime() {
		return super.getUpdateTime();
	}

	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
	@Override
	public OffsetDateTime getDeleteTime() {
		return super.getDeleteTime();
	}
}
